﻿package publics.model;

import java.io.Serializable;

import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.Table;

@Entity
@Table(name="t_company")
public class Company implements Serializable{

	private static final long serialVersionUID = 1L;

	/** 公司id */
	private Integer companyId;

	/** 公司名称 */
	private String companyName;
	
	private EnterpriseType etype;//公司类型

	/** 公司地址 */
	private String address;

	/** 公司电话 */
	private String tellPhone;

	/** 公司负责人 */
	private String leader;

	/** 公司负责人电话 */
	private String mobilePhone;

	/** 备注 */
	private String remark;


	@Id
	@GeneratedValue
	public Integer getCompanyId() {
		return companyId;
	}

	public void setCompanyId(Integer companyId) {
		this.companyId = companyId;
	}

	public String getCompanyName() {
		return companyName;
	}

	public void setCompanyName(String companyName) {
		this.companyName = companyName;
	}
	@ManyToOne(fetch=FetchType.LAZY)
	@JoinColumn(name="etype",nullable=false)	
	public EnterpriseType getEtype() {
		return etype;
	}

	public void setEtype(EnterpriseType etype) {
		this.etype = etype;
	}

	public String getAddress() {
		return address;
	}

	public void setAddress(String address) {
		this.address = address;
	}
	public String getLeader() {
		return leader;
	}

	public void setLeader(String leader) {
		this.leader = leader;
	}

	public String getMobilePhone() {
		return mobilePhone;
	}

	public void setMobilePhone(String mobilePhone) {
		this.mobilePhone = mobilePhone;
	}

	public String getRemark() {
		return remark;
	}

	public void setRemark(String remark) {
		this.remark = remark;
	}

	public String getTellPhone() {
		return tellPhone;
	}

	public void setTellPhone(String tellPhone) {
		this.tellPhone = tellPhone;
	}

	public Company() {
		super();
	}

	public Company(Integer companyId, String companyName, EnterpriseType etype,
			String address, String tellPhone, String leader,
			String mobilePhone, String remark) {
		super();
		this.companyId = companyId;
		this.companyName = companyName;
		this.etype = etype;
		this.address = address;
		this.tellPhone = tellPhone;
		this.leader = leader;
		this.mobilePhone = mobilePhone;
		this.remark = remark;
	}

	/* (non-Javadoc)
	 * @see java.lang.Object#toString()
	 */
	@Override
	public String toString() {
		return "Company [address=" + address + ", companyId=" + companyId
				+ ", companyName=" + companyName + ", etype=" + etype
				+ ", leader=" + leader + ", mobilePhone=" + mobilePhone
				+ ", remark=" + remark + ", tellPhone=" + tellPhone + "]";
	}




}
